package com.atguigu.bean;

import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * @author 伟哥
 */
public class Person {
    /**
     * 基本数据类型，
     *      直接使用<property name="lastName" value="小花"></property>自动的进行类型转换，然后赋值
 *              自动类型转换，怎么理解？
     *          xml叫做可扩展的标记语言，我们写的东西，都是纯文本，spring将配置文件的内容解析之后，再赋值给属性
     */
    private String lastName = "小明";
    private Integer age;
    private String gender;
    private String email;
    private Double salary;

    private Car car;

    private List<Book> bookList;

    private Map<String,Object> maps;

    private Properties properties;


    /**
     * 空参构造器
     */
    public Person() {
        System.out.println("Person创建...");
    }

    public Person(String lastName, Integer age, String gender) {
        this.lastName = lastName;
        this.age = age;
        this.gender = gender;
        System.out.println("有参构造器...中间参数age");
    }
    public Person(String lastName, String email, String gender) {
        this.lastName = lastName;
        this.gender = gender;
        this.email = email;
        System.out.println("有参构造器...中间参数email");
    }

    /**
     * 有参构造器
     * @param lastName 姓名
     * @param age 年龄
     * @param gender 性别
     * @param email 邮箱
     */
    public Person(String lastName, Integer age, String gender, String email) {
        this.lastName = lastName;
        this.age = age;
        this.gender = gender;
        this.email = email;
        System.out.println("有参构造器...4个参数");
    }

    /**
     * 此有参构造器，只有一个参数car，在自动装配中能为 Person的car赋值
     * @param car 只有一个参数
     */
    public Person(Car car) {
        System.out.println("此有参构造器，只有一个参数car，能为 car赋值");
        this.car = car;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public List<Book> getBookList() {
        return bookList;
    }

    public void setBookList(List<Book> bookList) {
        this.bookList = bookList;
    }

    public Map<String, Object> getMaps() {
        return maps;
    }

    public void setMaps(Map<String, Object> maps) {
        this.maps = maps;
    }

    public Properties getProperties() {
        return properties;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Person{" +
                "lastName='" + lastName + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", email='" + email + '\'' +
                ", salary=" + salary +
                ", car=" + car +
                ", bookList=" + bookList +
                ", maps=" + maps +
                ", properties=" + properties +
                '}';
    }
}
